package com.yyx.app1.MedicationAssistant_function.Controls.Medication_Activity_Control.drup_listview;

import android.content.Context;
import android.text.Html;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yyx.app1.R;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by yuexing on 2015/9/7.
 */
@EViewGroup(R.layout.itemview_listview_detaileddescription_drup)
public class Medication_ListView_ItemView extends LinearLayout {

    public Medication_ListView_ItemView(Context context) {
        super(context);
    }

    @ViewById
    TextView drup_item_text;

    @ViewById
    Button medication_titlename;

    public void bind(String titleName ,String text)
    {
        if(titleName.length()<3)
        {
            StringBuilder sb= new StringBuilder(titleName);
            sb.insert(1,"  ");
            titleName=sb.toString();
        }
        medication_titlename.setText(titleName);
        text = Html.fromHtml(text).toString();
        if(text.isEmpty())
            text="暂无";
        drup_item_text.setText(text);
    }
}
